package LeetCode;

public class LC_598_RangeAdditionII {

    public static void main(String[] args) {

    }

    class Solution {
        public int maxCount(int m, int n, int[][] ops) {
            if (ops == null || ops.length == 0) return m * n;
            int row = Integer.MAX_VALUE;
            int col = Integer.MAX_VALUE;
            for (int[] op : ops) {
                row = Math.min(row, op[0]);
                col = Math.min(col, op[1]);
            }
            return row * col;
        }
    }

    class Solution_2 {
        public int maxCount(int m, int n, int[][] ops) {
            int row = m;
            int col = n;
            for (int[] op : ops) {
                row = Math.min(row, op[0]);
                col = Math.min(col, op[1]);
            }
            return row * col;
        }
    }


}